package com.asset.dispoal.user.domain.db.mapper;

import com.asset.dispoal.user.domain.db.entity.BsLawyerDo;
import com.asset.dispoal.user.domain.db.entity.SysUserDo;
import com.asset.dispoal.user.dto.BsCourtInfo;
import com.asset.dispoal.user.dto.BsLawyerResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tech.mhuang.pacebox.springboot.protocol.data.Page;

import java.util.List;

/**
 * 人员表JDBC接口
 *
 * @author: mhuang
 * @date: 2022-01-21 15:30:03
 */
@Mapper
public interface SysUserMapper {


    int pageCount(SysUserDo sysUserDo);

    List<SysUserDo> page(@Param("page") Page page);


    void insert(SysUserDo sysUserDo);

    void update(SysUserDo sysUserDo);


    SysUserDo loginByAccount(@Param("account") String account, @Param("type") String type);

    void saveBatchUserRole(@Param("userId") String userId, @Param("roles") List<String> roles);

    void deleteUserRoleByUser(@Param("userId") String userId);

    /**
     * 添加律师信息
     *
     * @param bsLawyerRequest
     */
    void insertLawyer(@Param("bsLawyerRequest") BsLawyerDo bsLawyerRequest);

    /**
     * 修改律师信息
     *
     * @param bsLawyerRequest
     */
    void updateLawyer(@Param("bsLawyerRequest") BsLawyerDo bsLawyerRequest);

    /**
     * 查询律师详情
     *
     * @param userId
     * @return
     */
    BsLawyerResponse queryLawyerDetail(@Param("userId") String userId);

    int queryLawyerCountByCourtI(@Param("courtId") String courtId, @Param("lawyerName") String lawyerName, @Param("lawyerNum") String lawyerNum);

    List<BsLawyerResponse> queryLawyerByCourt(@Param("courtId") String courtId, @Param("lawyerName") String lawyerName, @Param("lawyerNum") String lawyerNum);

    Integer insertLawyerCourt(@Param("lawyerId") String id, @Param("courtId") String courtId);

    void deleteLawyerCourtByLawId(@Param("lawyerId") String lawyerId);

    List<BsCourtInfo> queryCourtByUserId(String userId);

    List<String> queryRoleByUserId(String userId);

    List<String> queryDepartmentByUserId(String userId);

    void updatePwd(@Param("id") String id, @Param("pwd") String password);

    SysUserDo getById(String id);
}